﻿using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Dryricenet.houTai
{
    public partial class leave_Reply : System.Web.UI.Page
    {
        public int id = 0;
        public string title = "";
        public string time = "";
        public string user = "";
        protected void Page_Load(object sender, EventArgs e)
        {
             id = Convert.ToInt32(Request.QueryString["LeaveID"]);
            if (!IsPostBack)
            {
               
                DataTable dt = LeaveBLL.leaveIdBLL(id);
                DataRow dr = dt.Rows[0];//第一条数据
                title= dr["Title"].ToString();
                txtContent.Text = dr["Content"].ToString();
                time = dr["Time"].ToString();
                user = dr["UserName"].ToString();
            }
        }
        //提交回复
        protected void Update_Button_Click(object sender, EventArgs e)
        {
            string hf = txtHf.Text.Trim();
            if (LeaveBLL.leaveHfBLL(hf, id))
            {
                Response.Write("<script>alert('回复成功！')</script>");
            }
            else
            {
                Response.Write("<script>alert('回复失败！')</script>");
            }
        }
    }
}